<!-- 
*   @Description:
*   @Author:lxy
*   @Date:2023-03-23 10:23
-->
<template>
  <div class="echartsPage_box">
    <titleHeader tilte="社区未来七天温度监测变化曲线"></titleHeader>
    <div class="echartsBox">
        <echartsTemplate :option="optionDijia"></echartsTemplate>
    </div>
  </div>
</template>

<script>
import titleHeader from "@/components/titleHeader.vue";
import echartsTemplate  from '@/components/echartsTemplate.vue'
import {dijiaOptionFunction} from '../config/echartsPage.js'
import {sevenDays} from '@/api/requ'
export default {
  name: "echartsPage",
  components: {
    titleHeader,
    echartsTemplate
  },
  data() {
    return {
        optionDijia:{}
    };
  },
  mounted(){
    this.getWeb()
    // this.optionDijia = dijiaOptionFunction()
  },
  methods:{
    getWeb(){
      let tempMax = []
      let tempMin = []
      let fxDate = []
      sevenDays().then(res=>{
        res.data.daily.forEach(item => {
            tempMax.push(item.tempMax)
            tempMin.push(item.tempMin)
            fxDate.push(item.fxDate)
        });
        this.optionDijia = dijiaOptionFunction({tempMax,tempMin,fxDate})
      })
    }
  }
};
</script>

<style scoped lang="less">
.echartsPage_box{
    margin: 15px 0px 0px 0px;
    background-color: #fff;
}
.echartsBox{
    padding-top: 15px;
    height: 400px;
    width: 100%;
}
</style>
